package com.example.haiti_infrastructure_prototype;

import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;


public class MainActivity extends Activity {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        //Sets click listener for questionnaire button
        Button btnQuestionnaire = (Button)findViewById(R.id.questionnaireButton);
        btnQuestionnaire.setOnClickListener(qButton);   
        
        //Sets click listener for photo button
        Button btnPhoto = (Button)findViewById(R.id.photoButton);
        btnPhoto.setOnClickListener(photoButton);  
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
  //---create qButton click listener
    private OnClickListener qButton = new OnClickListener()
    {
        public void onClick(View v)
        {  
        	Intent i = new Intent(getApplicationContext(), QuestionnaireActivity.class);
        	startActivity(i);
        	
           Toast.makeText(getBaseContext(), 
                    "Questions!", 
                    Toast.LENGTH_LONG).show();
           
        }
    }; 
    
    // create photoButton click listener
    private OnClickListener photoButton = new OnClickListener()
    {
        public void onClick(View v)
        {  
        	
        	Intent i = new Intent(getApplicationContext(), PhotoActivity.class);
        	startActivity(i);
        	
        	Toast.makeText(getBaseContext(), 
            "Photo!", 
            Toast.LENGTH_LONG).show();
	
        }
    }; 
}
